<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:icecore="http://www.icefaces.org/icefaces/core"
      xmlns:ace="http://www.icefaces.org/icefaces/components"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      >
    <h:head>
        <title>Tabela de Livros</title>
        <link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css"/>
    </h:head>
    <h:body styleClass="ice-skin-rime">
        
        <h:form id="form">
            <ice:panelGrid columns="1">
                <h:outputText value="Livros"/>

                <ice:dataPaginator for="tabela1" fastStep="3" paginator="true" paginatorMaxPages="4">
                    <f:facet name="first">
                        <ice:graphicImage
                            url="./xmlhttp/css/xp/css-images/arrow-first.gif"
                            style="border:none;"
                            title="First Page"/>
                    </f:facet>
                    <f:facet name="last">
                        <ice:graphicImage
                            url="./xmlhttp/css/xp/css-images/arrow-last.gif"
                            style="border:none;"
                            title="Last Page"/>
                    </f:facet>
                    <f:facet name="previous">
                        <ice:graphicImage
                            url="./xmlhttp/css/xp/css-images/arrow-previous.gif"
                            style="border:none;"
                            title="Previous Page"/>
                    </f:facet>
                    <f:facet name="next">
                        <ice:graphicImage
                            url="./xmlhttp/css/xp/css-images/arrow-next.gif"
                            style="border:none;"
                            title="Next Page"/>
                    </f:facet>
                    <f:facet name="fastforward">
                        <ice:graphicImage 
                            url="./xmlhttp/css/xp/css-images/arrow-ff.gif"
                            style="border:none;"
                            title="Fast Forward"/>
                    </f:facet>
                    <f:facet name="fastrewind">
                        <ice:graphicImage 
                            url="./xmlhttp/css/xp/css-images/arrow-fr.gif"
                            style="border:none;"
                            title="Fast Backwards"/>
                    </f:facet>
                </ice:dataPaginator>
                <ice:outputConnectionStatus/>
                <ice:dataTable value="#{tabela1Bean.livros}" var="livro" 
                               id="tabela1" rows="5" border="1">
                    <ice:column>
                        <f:facet name="header">
                            <f:verbatim>Livro ID</f:verbatim>
                        </f:facet>
                        <ice:commandButton value="#{livro.livro_id}" actionListener="#{tabela1Bean.mostraDados}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header">
                            <f:verbatim>Titulo</f:verbatim>
                        </f:facet>
                        <ice:outputText value="#{livro.titulo}"/>
                    </ice:column>
                    <ice:column>
                        <f:facet name="header">
                            <f:verbatim>Autor</f:verbatim>
                        </f:facet>
                        <ice:outputText value="#{livro.autor}"/>
                    </ice:column>

                    <ice:column>
                        <f:facet name="header">
                            <f:verbatim>Ações</f:verbatim>
                        </f:facet>
                        <ice:commandButton value="#{livro.livro_id}" actionListener="#{tabela1Bean.editar}" />
                    </ice:column>

                </ice:dataTable>
            </ice:panelGrid>
            
            <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="2" border="0">
                <ice:outputText value="codigo:"/>
                <ice:inputText value="#{tabela1Bean.codigo}"/>
                <ice:outputText value="titulo:"/>
                <ice:inputText value="#{tabela1Bean.titulo}"/>
                <ice:outputText value="autor:"/>
                <ice:inputText value="#{tabela1Bean.autor}"/>
                <ice:outputText value="editora:"/>
                <ice:inputText value="#{tabela1Bean.editora}"/>
                <ice:outputText value="descricao:"/>
                <ice:inputText value="#{tabela1Bean.descricao}"/>
                <ice:outputText value="estoque:"/>
                <ice:inputText value="#{tabela1Bean.estoque}"/>
                <ice:outputText value="preco:"/>
                <ice:inputText value="#{tabela1Bean.preco}"/>
                <ice:outputText value="estoque:"/>
                <ice:inputText value="#{tabela1Bean.estoque}"/>
                <ice:outputText value="ano:"/>
                <ice:inputText value="#{tabela1Bean.ano}"/>
                <ice:outputText value="Capa:"/>
                <ice:graphicImage value="#{tabela1Bean.capa}"/>
                <ice:commandButton value="Fechar" actionListener="#{tabela1Bean.escondeDados}"/>   
            </ice:panelGrid>
                        
            <ice:panelPopup draggable="true" modal="true"  visible="#{tabela1Bean.popupVisivel}">
                <f:facet name="header">
                    <ice:outputText value="Dados de livro"/>
                </f:facet>
                <f:facet name="body">
                    <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="2">
                        <ice:outputText value="Título:"/>
                        <ice:inputText value="#{tabela1Bean.titulo}"/>
                        <ice:outputText value="Autor:"/>
                        <ice:inputText value="#{tabela1Bean.autor}"/>
                        <ice:outputText value="Capa:"/>
                        <ice:graphicImage value="#{tabela1Bean.capa}"/>
                        <ice:commandButton value="Fechar" actionListener="#{tabela1Bean.escondeDados}"/>
                    </ice:panelGrid>
                </f:facet>
            </ice:panelPopup>
        </h:form>
    </h:body>
    <h:outputStylesheet library="org.icefaces.component.skins" name="rime.css" />
</html>